﻿using UnityEngine;
using System.Collections;
using Sa1;

public class Food : MonoBehaviour {

    public readonly Container container = new Container("[Foods]");

    // Use this for initialization
    void Start() {
        container.set(this.gameObject);
    }

    // Update is called once per frame
    void Update() {

    }

    void OnTriggerEnter2D(Collider2D coll) {
        if (coll.tag == "spore") {
            Destroy(this.gameObject);
            // TODO send message to the player
            // TODO check if this behaviour is in the server side
            if (FoodSpawner.Instance) {
                FoodSpawner.Instance.addAFoodToQueue();
            }
        }
    }
}
